public class TestPolymorphism {
    public static void main(String[] args) {
        Device[] devices = {
                new Projector("索尼"),
                new Printer("惠普"),
                new AirConditioner("格力")
        };
        System.out.println("=== 设备开机 ===");
        for (Device d : devices){
            d.powerOn();
        }
        System.out.println("=== 设备报修 ===");
        for (Device d : devices){
            d.repair();
        }
    }
}
